.class public Lde/dealdoktor/app/util/AsyncImageLoader;
.super Ljava/lang/Object;
.source "AsyncImageLoader.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallback;,
        Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallbackDrawable;
    }
.end annotation


# instance fields
.field private imageCache:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/ref/SoftReference",
            "<",
            "Landroid/graphics/Bitmap;",
            ">;>;"
        }
    .end annotation
.end field

.field private imageCacheDrawable:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/ref/SoftReference",
            "<",
            "Landroid/graphics/drawable/Drawable;",
            ">;>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 18
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 19
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCache:Ljava/util/HashMap;

    .line 20
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCacheDrawable:Ljava/util/HashMap;

    .line 21
    return-void
.end method

.method static synthetic access$0(Lde/dealdoktor/app/util/AsyncImageLoader;)Ljava/util/HashMap;
    .locals 1
    .parameter

    .prologue
    .line 16
    iget-object v0, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCacheDrawable:Ljava/util/HashMap;

    return-object v0
.end method

.method static synthetic access$1(Lde/dealdoktor/app/util/AsyncImageLoader;)Ljava/util/HashMap;
    .locals 1
    .parameter

    .prologue
    .line 15
    iget-object v0, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCache:Ljava/util/HashMap;

    return-object v0
.end method


# virtual methods
.method public loadBitmap(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallback;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 1
    .parameter "imageUrl"
    .parameter "imageCallback"
    .parameter "defaultBitmap"

    .prologue
    .line 62
    const-string v0, ""

    invoke-virtual {p0, p1, p2, p3, v0}, Lde/dealdoktor/app/util/AsyncImageLoader;->loadBitmap(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallback;Landroid/graphics/Bitmap;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    return-object v0
.end method

.method public loadBitmap(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallback;Landroid/graphics/Bitmap;Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 4
    .parameter "imageUrl"
    .parameter "imageCallback"
    .parameter "defaultBitmap"
    .parameter "id"

    .prologue
    .line 66
    iget-object v3, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCache:Ljava/util/HashMap;

    invoke-virtual {v3, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 67
    iget-object v3, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCache:Ljava/util/HashMap;

    invoke-virtual {v3, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/ref/SoftReference;

    .line 68
    .local v2, softReference:Ljava/lang/ref/SoftReference;,"Ljava/lang/ref/SoftReference<Landroid/graphics/Bitmap;>;"
    invoke-virtual {v2}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/graphics/Bitmap;

    .line 69
    .local v0, drawable:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_0

    .line 100
    .end local v0           #drawable:Landroid/graphics/Bitmap;
    .end local v2           #softReference:Ljava/lang/ref/SoftReference;,"Ljava/lang/ref/SoftReference<Landroid/graphics/Bitmap;>;"
    :goto_0
    return-object v0

    .line 73
    :cond_0
    new-instance v1, Lde/dealdoktor/app/util/AsyncImageLoader$3;

    invoke-direct {v1, p0, p2, p1, p4}, Lde/dealdoktor/app/util/AsyncImageLoader$3;-><init>(Lde/dealdoktor/app/util/AsyncImageLoader;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallback;Ljava/lang/String;Ljava/lang/String;)V

    .line 79
    .local v1, handler:Landroid/os/Handler;
    new-instance v3, Lde/dealdoktor/app/util/AsyncImageLoader$4;

    invoke-direct {v3, p0, p1, v1}, Lde/dealdoktor/app/util/AsyncImageLoader$4;-><init>(Lde/dealdoktor/app/util/AsyncImageLoader;Ljava/lang/String;Landroid/os/Handler;)V

    .line 99
    invoke-virtual {v3}, Lde/dealdoktor/app/util/AsyncImageLoader$4;->start()V

    move-object v0, p3

    .line 100
    goto :goto_0
.end method

.method public loadDrawable(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallbackDrawable;)Landroid/graphics/drawable/Drawable;
    .locals 2
    .parameter "imageUrl"
    .parameter "imageCallback"

    .prologue
    .line 24
    const/4 v0, 0x0

    const-string v1, ""

    invoke-virtual {p0, p1, p2, v0, v1}, Lde/dealdoktor/app/util/AsyncImageLoader;->loadDrawable(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallbackDrawable;Landroid/graphics/drawable/Drawable;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method public loadDrawable(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallbackDrawable;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .parameter "imageUrl"
    .parameter "imageCallback"
    .parameter "defaultDrawable"

    .prologue
    .line 28
    const-string v0, ""

    invoke-virtual {p0, p1, p2, p3, v0}, Lde/dealdoktor/app/util/AsyncImageLoader;->loadDrawable(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallbackDrawable;Landroid/graphics/drawable/Drawable;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method public loadDrawable(Ljava/lang/String;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallbackDrawable;Landroid/graphics/drawable/Drawable;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;
    .locals 4
    .parameter "imageUrl"
    .parameter "imageCallbackDrawable"
    .parameter "defaultDrawable"
    .parameter "id"

    .prologue
    .line 32
    const-string v3, ""

    invoke-virtual {p1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 58
    .end local p3
    :goto_0
    return-object p3

    .line 36
    .restart local p3
    :cond_0
    iget-object v3, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCacheDrawable:Ljava/util/HashMap;

    invoke-virtual {v3, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 37
    iget-object v3, p0, Lde/dealdoktor/app/util/AsyncImageLoader;->imageCacheDrawable:Ljava/util/HashMap;

    invoke-virtual {v3, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/ref/SoftReference;

    .line 38
    .local v2, softReference:Ljava/lang/ref/SoftReference;,"Ljava/lang/ref/SoftReference<Landroid/graphics/drawable/Drawable;>;"
    invoke-virtual {v2}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/graphics/drawable/Drawable;

    .line 39
    .local v0, drawable:Landroid/graphics/drawable/Drawable;
    if-eqz v0, :cond_1

    move-object p3, v0

    .line 40
    goto :goto_0

    .line 43
    .end local v0           #drawable:Landroid/graphics/drawable/Drawable;
    .end local v2           #softReference:Ljava/lang/ref/SoftReference;,"Ljava/lang/ref/SoftReference<Landroid/graphics/drawable/Drawable;>;"
    :cond_1
    new-instance v1, Lde/dealdoktor/app/util/AsyncImageLoader$1;

    invoke-direct {v1, p0, p2, p1, p4}, Lde/dealdoktor/app/util/AsyncImageLoader$1;-><init>(Lde/dealdoktor/app/util/AsyncImageLoader;Lde/dealdoktor/app/util/AsyncImageLoader$ImageCallbackDrawable;Ljava/lang/String;Ljava/lang/String;)V

    .line 49
    .local v1, handler:Landroid/os/Handler;
    new-instance v3, Lde/dealdoktor/app/util/AsyncImageLoader$2;

    invoke-direct {v3, p0, p1, v1}, Lde/dealdoktor/app/util/AsyncImageLoader$2;-><init>(Lde/dealdoktor/app/util/AsyncImageLoader;Ljava/lang/String;Landroid/os/Handler;)V

    .line 57
    invoke-virtual {v3}, Lde/dealdoktor/app/util/AsyncImageLoader$2;->start()V

    goto :goto_0
.end method
